import { param2Obj } from './utils'

const tokens = {
  admin: {
    token: 'admin'
  },
  editor: {
    token: 'editor-token'
  }
}

const users = {
  'admin-token': {
    roles: ['admin'],
    introduction: 'I am a super administrator',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Super Admin'
  },
  'editor-token': {
    roles: ['editor'],
    introduction: 'I am an editor',
    avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
    name: 'Normal Editor'
  }
}

export default {
  login: res => {
    return {
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiJhZG1pbiIsInVzZXJJZCI6bnVsbCwiY29tcGxldGVDb2RlIjoxLCJjbGllbnRfaWQiOiJvcGVyYXRpb25fd2ViX25ldyIsInRva2VuIjoiZXlKaGJHY2lPaUpJVXpVeE1pSjkuZXlKc2IyZHBibDkxYzJWeVgydGxlU0k2SWpGaE1XUmlZbVV3TFdSbU5qWXRORFV4WmkxaU5UaGtMVFJpWmpFd05UZGlNMlV6WXlKOS5Ub1dWNkwzMzlwei1sVWhjZ1dqTkx5Yk9qUW5vWUFpVlNGYi1vcV9rcDRxSkRpMkw5Q2NTSzRJSXdFWXN5ckhMQlh6anFWd1R4VVo1Q2dyeUV2UEt2dyIsInVzZXJUb2tlbiI6Imd0WWF1bGhTMVpyVUFoJTJGRGlqTzV3NW5xeGtkajhSR3dYOVlKQUlUYXVVVDMlMkZxcEtiTVBDeEh2VGlQTXd4V0hjd202YzlMSW1ndzFldE9NQ3FENHVHdyUzRCUzRCIsImF1ZCI6WyJodWFjaGluZy1vcGVuYXBpIl0sImNvbXBhbnlJZCI6bnVsbCwic2NvcGUiOlsib3BlcmF0aW9uX3dlYl9uZXciXSwibmlja25hbWUiOm51bGwsImV4cCI6MTcwMDQzODU0NCwianRpIjoiYjFhOTlhN2YtYjkzNC00ODNiLWI2MzEtMTk3NmUyNDViNTg3IiwicGFyayI6bnVsbH0.EeVdfpp_L8daTqIY78EISD7gXijJEX7BHSxm6ANjQbk",
      "token_type": "bearer",
      "expires_in": 2500000,
      "scope": "operation_web_new",
      "userToken": "gtYaulhS1ZrUAh%2FDijO5w5nqxkdj8RGwX9YJAITauUT3%2FqpKbMPCxHvTiPMwxWHcwm6c9LImgw1etOMCqD4uGw%3D%3D",
      "companyId": null,
      "nickname": null,
      "userId": null,
      "park": null,
      "completeCode": 1,
      "token": "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjFhMWRiYmUwLWRmNjYtNDUxZi1iNThkLTRiZjEwNTdiM2UzYyJ9.ToWV6L339pz-lUhcgWjNLybOjQnoYAiVSFb-oq_kp4qJDi2L9CcSK4IIwEYsyrHLBXzjqVwTxUZ5CgryEvPKvw",
      "jti": "b1a99a7f-b934-483b-b631-1976e245b587"
    }
  },
  getInfo: res => {
    return {
      "completeCode": 1,
      "reasonCode": "000000",
      "reasonMessage": "成功",
      "data": {
        "user": {
          "createBy": "admin",
          "createTime": "2022-11-22 15:37:57",
          "updateBy": null,
          "updateTime": null,
          "remark": "管理员",
          "userId": 1,
          "deptId": 100,
          "userName": "admin",
          "nickName": "管理员",
          "email": "123@qq.com",
          "phonenumber": "15888888888",
          "sex": "1",
          "avatar": "",
          "password": "$2a$10$7IBI9i4DXmvmksZfaN0m6ehIn.WZvQ7Iptbqn.nj.EAMYmo87LIee",
          "status": "0",
          "delFlag": "0",
          "openid": "oeFHb54OmIJIqcg2FkrdRG2kpKTc",
          "loginIp": "172.10.68.68",
          "loginDate": 1697880169000,
          "dept": {
            "createBy": null,
            "createTime": null,
            "updateBy": null,
            "updateTime": null,
            "remark": null,
            "deptId": 100,
            "parentId": 0,
            "ancestors": "0",
            "level": null,
            "deptName": "平台",
            "orderNum": 0,
            "leader": "黄青蓝",
            "phone": null,
            "email": null,
            "status": "0",
            "delFlag": null,
            "parentName": null,
            "children": []
          },
          "roles": [
            {
              "createBy": null,
              "createTime": null,
              "updateBy": null,
              "updateTime": null,
              "remark": null,
              "roleId": 1,
              "roleName": "超级管理员",
              "roleKey": "admin",
              "roleSort": "1",
              "dataScope": "1",
              "menuCheckStrictly": false,
              "deptCheckStrictly": false,
              "status": "0",
              "delFlag": null,
              "flag": false,
              "menuIds": null,
              "deptIds": null,
              "permissions": null,
              "admin": true
            },
            {
              "createBy": null,
              "createTime": null,
              "updateBy": null,
              "updateTime": null,
              "remark": null,
              "roleId": 2,
              "roleName": "管理员（海宁智慧停车）",
              "roleKey": "common",
              "roleSort": "2",
              "dataScope": "1",
              "menuCheckStrictly": false,
              "deptCheckStrictly": false,
              "status": "0",
              "delFlag": null,
              "flag": false,
              "menuIds": null,
              "deptIds": null,
              "permissions": null,
              "admin": false
            }
          ],
          "roleIds": null,
          "postIds": null,
          "roleId": null,
          "admin": true
        },
        "permissions": [
          "*:*:*"
        ],
        "roles": [
          "admin"
        ]
      },
      "responseOk": true
    }
  },

  getMenu: res => {
    return {
      "code": 0,
      "reasonCode": "000000",
      "reasonMessage": "成功",
      "data": [
        {
          "name": "CarSource",
          "path": "/carsource",
          "hidden": false,
          "redirect": "noRedirect",
          "component": "Layout",
          "alwaysShow": true,
          "meta": {
            "title": "车源管理",
            "icon": "list",
            "noCache": true,
            "link": null
          },
          "children": [
            {
              "name": "ShopList",
              "path": "shop",
              "hidden": false,
              "component": "carsource/shop/index",
              "meta": {
                "title": "门店管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "AppraiserList",
              "path": "appraiser",
              "hidden": false,
              "component": "carsource/appraiser/index",
              "meta": {
                "title": "评估师管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "StoreList",
              "path": "store",
              "hidden": false,
              "component": "carsource/store/index",
              "meta": {
                "title": "库存管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "PackageList",
              "path": "package",
              "hidden": false,
              "component": "carsource/package/index",
              "meta": {
                "title": "车包管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "AuctionList",
              "path": "auction",
              "hidden": false,
              "component": "carsource/auction/index",
              "meta": {
                "title": "拍卖管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "Report",
              "path": "report",
              "hidden": false,
              "component": "carsource/report/index",
              "meta": {
                "title": "分析报表",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
          ]
        },
        {
          "name": "CarBusiness",
          "path": "/carbusiness",
          "hidden": false,
          "redirect": "noRedirect",
          "component": "Layout",
          "alwaysShow": true,
          "meta": {
            "title": "车商管理",
            "icon": "list",
            "noCache": true,
            "link": null
          },
          "children": [
            {
              "name": "BusinessList",
              "path": "business",
              "hidden": false,
              "component": "carbusiness/business/index",
              "meta": {
                "title": "车商列表",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "Report",
              "path": "report",
              "hidden": false,
              "component": "carbusiness/report/index",
              "meta": {
                "title": "分析报表",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
          ]
        },
        {
          "name": "User",
          "path": "/user",
          "hidden": false,
          "redirect": "noRedirect",
          "component": "Layout",
          "alwaysShow": true,
          "meta": {
            "title": "用户管理",
            "icon": "list",
            "noCache": true,
            "link": null
          },
          "children": [
            {
              "name": "UserList",
              "path": "userlist",
              "hidden": false,
              "component": "user/list/index",
              "meta": {
                "title": "用户列表",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
            {
              "name": "Group",
              "path": "group",
              "hidden": false,
              "component": "user/group/index",
              "meta": {
                "title": "用户组管理",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            }, {
              "name": "Permissions",
              "path": "permissions",
              "hidden": false,
              "component": "user/permissions/index",
              "meta": {
                "title": "权限列表",
                "icon": "#",
                "noCache": true,
                "link": null
              }
            },
          ]
        }

      ]
    }
  },
  logout: () => {
    return {
      code: 20000,
      data: 'success'
    }
  }
}
